#include<bits/stdc++.h>
using namespace std;

int cnt['a'];

int main()
{
	string s;
	cin>>s;
	transform(s.begin(), s.end(), s.begin(), ::toupper);
	int len = s.size();
	for(int i = 1;i <= len;i++)
	{
		if(s[i-1] != s[i])
		{
			printf("(%c,%d)", s[i-1], cnt[s[i-1]]+1);
			cnt[s[i-1]] = 0;
		}
		else
			cnt[s[i-1]]++;
	}
    return 0;
}

